<template>
  <div class="pagination">
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="page"
      :page-sizes="[5, 10, 15, 20]"
      :page-size="rows"
      layout="total, sizes, prev, pager, next, jumper"
      :total="componentTotal"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    page: Number,
    rows: Number,
    componentTotal: Number,
  },
  data() {
    return {};
  },
  methods: {
    handleSizeChange(val) {
      this.$emit("changeRows", val)
    },
    handleCurrentChange(val) {
      this.$emit("changePage", val)
    },
  },
};
</script>

<style lang="scss" scoped>
.pagination{
    margin-top: 12px;
}
</style>